#include<stdio.h>
int main(){
	int n = 0;
	int k = 0;
	int i = 0;
	int A = 0;
	int B = 0;
	scanf("%d",&n);
	scanf("%d",&k) ;
	float count_a = 0.0;
	float count_b = 0.0;
	for(i=1;i<=n;i++){
		if(i%k==0){
			A += i;
			count_a++;
		} 
		else{
			B += i;
			count_b++;
		}	
	} 
	printf("%.1f ",A / count_a);
	printf("%.1f",B / count_b); 
} 
